package collection;

import java.util.HashMap;
import java.util.Map;

public class MapAdd {
    public static void main(String[] args) {
        Map<String, Integer> mp = new HashMap<String, Integer>();
        mp.put("hello", 20);
        mp.put("java!", 10);
        mp.put("hello", 30);
        mp.put("world!", 40);
        System.out.println(mp);
        System.out.println(mp.put("java!", 30));
        System.out.println(mp);
        Map<String, Integer> mp2 = new HashMap<String, Integer>();
        mp2.put("watch tv at home", 10);
        mp.putAll(mp2);
        System.out.println(mp);
        System.out.println(mp.get("java!"));
        System.out.println(mp.size());
        System.out.println(mp.containsKey("hello"));
        System.out.println(mp.containsValue(30));

    }
}
